import {Point} from './point.js'

export class Circle
{
    yuanxin = null//初始化
    radius = 0;

    constructor(yuanxin,radius)
    {
        this.yuanxin = yuanxin
        this.radius = radius
    }
    isPointInCircle(point)
    {
        let distance = this.yuanxin.get_distance(point)
        return distance <= this.radius//看看点到圆心的距离是否小于等于半径长度
    }
}

let point = new Point(0,0)
let c1 = new Circle(point,2)
console.log(c1);

let point22 = new Point(2,2)
let result = c1.isPointInCircle(point22)
console.log(result);